package com.xiaomaoguai.webkit.model;

import java.io.Serializable;

public class MessageModel implements Serializable {

	private static final long serialVersionUID = 1L;

	private String msg;
	private Integer code;
	private boolean success;

	public MessageModel() {
	}

	public MessageModel(boolean success) {
		this.success = success;
	}

	public MessageModel(MessageState state) {
		this.code = state.getIndex();
		this.success = state.isSuccess();

	}

	public MessageModel(Integer code) {
		this.code = code;
	}

	public MessageModel(MessageState state, String msg) {
		this.code = state.getIndex();
		this.success = state.isSuccess();
		this.msg = msg;
	}

	public MessageModel(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public MessageModel(boolean success, String msg) {
		this.success = success;
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	@Override
	public String toString() {
		return "MessageModel [msg=" + msg + ", code=" + code + ", success=" + success + "]";
	}

}